<?php
/**
 * Library for easier ordering and filtering records.
 *
 * @author Martin "DevelX" Jurča
 * @version 2009-02-24
 */
interface RecordList {
    /**
     * Creates new RecordList object.
     * 
     * @param DBAPI $dbapi DataBase API object.
     */
    public function __construct(DBAPI $dbapi);

    /**
     * Loads list of records data according to the parameters.
     *
     * @param Array $dataModel Data model of records to load.
     * @param Array $parameters List parameters. Parameters are these:
     *          - count: Maximum number of records to return
     *          - start: How many items from beggining should be ommited
     *          - order: Array of properties that should be used to order
     *                   the items in list - used same way as with select
     *                   method of DBDriver.
     *     - properties: array of properties that should be returned. Use
     *                   null or do not set this key to return all values.
     *         - filter: optional conditions for filtering items
     * @return Array List of items. Only record data is returned,
     *         information about properties and table is not attached.
     */
    public function &getList(&$dataModel, &$parameters);
}
?>
